#include "CVector4d.h"



 
CVector4d::CVector4d( const fixed* ijkw )
{ 
	ASSERT( ijkw );

	m_i = *ijkw;
	m_j = *( ijkw + 1 );
	m_k = *( ijkw + 2 );
	m_w = *( ijkw + 3 );
}


CVector4d& CVector4d::operator=( const fixed* ijkw )
{
	ASSERT( ijkw );

	m_i = *ijkw;
	m_j = *( ijkw + 1 );
	m_k = *( ijkw + 2 );
	m_w = *( ijkw + 3 );

	return *this;
}


CVector4d& CVector4d::operator=( const CVector3d& v )
{
	m_i = v.m_i;
	m_j = v.m_j;
	m_k = v.m_k;

	return *this;
}

	
CVector4d& CVector4d::operator+=( const CVector4d& v )
{
	m_i += v.m_i;
	m_j += v.m_j;
	m_k += v.m_k;
	m_w += v.m_w;

	return *this;
}


CVector4d& CVector4d::operator+=( fixed val )
{
	m_i += val;
	m_j += val;
	m_k += val;
	m_w += val;

	return *this;
}


CVector4d& CVector4d::operator-=( const CVector4d& v )
{
	m_i -= v.m_i;
	m_j -= v.m_j;
	m_k -= v.m_k;
	m_w -= v.m_w;

	return *this;
}


CVector4d& CVector4d::operator-=( fixed val )
{
	m_i -= val;
	m_j -= val;
	m_k -= val;
	m_w -= val;

	return *this;
}


CVector4d& CVector4d::operator*=( fixed val )
{
	m_i = CMathFixed::Mul( m_i, val );
	m_j = CMathFixed::Mul( m_j, val );
	m_k = CMathFixed::Mul( m_k, val );
	m_w = CMathFixed::Mul( m_w, val );

	return *this;
}


CVector4d& CVector4d::operator/=( fixed val )
{
	m_i = CMathFixed::Div( m_i, val );
	m_j = CMathFixed::Div( m_j, val );
	m_k = CMathFixed::Div( m_k, val );
	m_w = CMathFixed::Div( m_w, val );

	return *this;
}

